

Array.prototype.unique = function(){
  let temp = {},
      arr=[],
      len= this.length;
      for(let i = 0;i<len;i++){
        if(!temp[this[i]]){
          temp[this[i]] = i
          arr.push(this[i])
        }
      }
      return arr
}
Array.prototype.unique1 = function(){
  let temp = {},
      arr=[],
      len= this.length;
      for(let i = 0;i<len;i++){
        if(!temp[this[i]]){
          temp[this[i]] = i
          arr.push(this[i])
        }
      }
      return arr
}
var a = [1,2,5,{name:'1'},11,{name:'1',a:'2'},22,0,0,{name:'1'}]

a = a.unique()
console.log(a)


var b = [1,1,2,2,2,3,44,55,2,0,0,0,10,10,10,1,1,1,1,1]
b = new Set(b)
console.log(b)